package com.kll.tv.views.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter

/**
 * 滑动View适配器
 */
class ViewPagerAdapter: FragmentPagerAdapter {
    private var fragments: MutableList<Fragment>? = null

    constructor(fm: FragmentManager, fragments: MutableList<Fragment>): super(fm) {
        this.fragments = fragments
    }

    override fun getItem(i: Int): Fragment {
        return fragments!![i]
    }

    override fun getCount(): Int {
        return fragments!!.size
    }
}